<!doctype html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
		<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
		<link rel="stylesheet" type="text/css" href="../../css/aui.css" />
		<link rel="stylesheet" type="text/css" href="../../css/yzl.css" />
		<link rel="stylesheet" type="text/css" href="../../css/api.css"/>
		<style type="text/css">
			#tx {
				border-radius: 50%;
				display: inline;
				position: absolute;
				top: 7px;
				left: 3px;
			}
			*{
				-webkit-box-sizing: inherit;
								box-sizing: inherit;
			}
			.title{
				max-width: 60%;
				white-space: nowrap;
				overflow: hidden;
				text-overflow: ellipsis;
				vertical-align: middle;
			}
			body{
				background-color: #f7f7f7;
			}
		</style>
	</head>
	<body>
		<div id="app" class="header" >
	      <div v-back.tapmode class="back"></div>
	      <span class="title" v-cloak>{{zh}}</span>
	  </div>
	</body>
	<script src="../../script/api.js"></script>
	<script src="../../script/vue.js"></script>
	<script src="../../script/app.js"></script>
	<script src="../../script/common.js"></script>
	<script src="../../script/url.js"></script>

	<script type="text/javascript">
		var id;
		var tx;
		var zh;
		var level_id;
		var friend_id;
		var memberinfo;

		apiready = function() {
			setBSImg();
			api.parseTapmode();
			var html = '';
			 id = api.pageParam.id;
			 tx = api.pageParam.tx;
			 zh = api.pageParam.zh;
			 level_id = api.pageParam.level_id;
			 friend_id = api.pageParam.friend_id;
			 //获取最新的会员信息
			 var data = {
					 member_id: getPrefs('member_id'),
					 friend_id: friend_id,
			 };
			 var callback = function (ret) {
					 memberinfo = ret.content;

					 initApp();
					 open_chat_frame();
					 api.parseTapmode();
			 };
			 pinet.post(URL.getFriendInfo, data, callback);
			// $api.html($api.dom('.aui-title'), html);
			$api.fixStatusBar($api.byId('head'));
			// var head_h = $api.offset($api.byId('head')).h;

		};
		function open_chat_frame() {
			api.openFrame({
				name : 'frame_chat',
				url : '../frame/frame_chat.html',
				bgColor : 'f7f7f7',
				rect : {
					x: 0,
					y: 60,
					w: api.winWidth,
					h: api.winHeight - 60
				},
				hScrollBarEnabled : false,
				vScrollBarEnabled : false,
				pageParam : {
					head_h : 60,
					id : id,
					zh : memberinfo.mark_name?memberinfo.mark_name:memberinfo.nickname,
					tx : memberinfo.portrait,
					level_id:memberinfo.level_id,
					friend_id:memberinfo.friend_id,
					h:api.winHeight - 60
				}
			});
		}
		function initApp(){
			vm = new Vue({
					el: '#app',
					data: {
							id:id,
							tx:tx,
							zh:zh,

					},
					computed: {
					},
					methods: {
					}

			});
		}
		function closeWin() {
			api.closeWin({
			});
		}
	</script>
</html>
